package frame.options.simulation.results.sdn.graphical;

import java.awt.Color;
import java.awt.Paint;

import model.components.links.link.Link;
import model.components.links.link.SdnLink;

import org.apache.commons.collections15.Transformer;

public class SdnLinkColorTransformer implements Transformer< Link, Paint >
{
	@Override
	public Paint transform( Link link )
	{
		if( link.isSelected() )
			return Color.GREEN;
		
		else if( ( (SdnLink) link ).getAvailableBW() < link.getBW() * 0.2 )
			return Color.RED;
		
		else if( ( (SdnLink) link ).getAvailableBW() < link.getBW() )
			return Color.YELLOW;
		
		else
			return Color.BLACK;
	}
}
